005 basic displays

是时候开始对一些显示进行编程了,在上一讲中,我们确实 Kenichi 做了一些工作,因为对于我们的数字输入,我们最终也显示了值,所以我们已经初步预览了如何显示一些值,但还有一些显示的更多可能性,因此我们也会研究其中的一些。
OK time to start programming some displays in the last lecture we really Kenichi did a little bit because for our numeric entry we ended up displaying the value as well so we kind of already have a sneak preview of how to display some values but there are some more possibilities for displays so we will look into some of those as well.

我们要做的第一件事是让我们继续并开始研究如何显示我们的位。
First thing we want to do though let's go ahead and start looking at how to display our bits.

因此,如果我打开工具箱,我会得到一些可以使用的不同工具。
So if I pull open my tool box I have a handful of different tools which I can use.

例如,我可以使用按位显示消息。
For instance I can use a message display by bit.

我可以使用按值显示图像,我可以按位使用消息列表,这样我实际上可以使屏幕显示不同的文本字符串、不同的图片,并且所有这些都基于整数的值或位的值。
I can use an image display by value I can use a message list by bit so I can actually make the screen show different strings of text different pictures and all based on what the value of let's say an integer is or the value of a bit.

所以我也可以显示米。
So I can also show meters.

我有很多不同的选择。
I've got lots of different options.

所以现在我要做一些非常简单的事情,我只是要在这里拉上这个指示灯,让我把它向上移动一点。
So for right now I'm going to do something really simple and I'm just going to pull in this pilot light right here let me move that up a little bit.

正确的。
Right.

让我们重新配置一些东西,这样我将再次将四种颜色更改为黑色,以便我实际上可以看到它,并且我将更改我的指示灯和一个要运行的文本。
And let's reconfigure this some things so I'm going to change my four color once again to black so that I can actually see it and I'm going to change my pilot light and one text to run.

所以这对我们来说只是一个运行指标。
So that is just going to be a run indicator for us.

由于我们使用这种风格的指示器,我将使用类似的按钮。
And since we're using that style of indicator I'm going to use a similar button.

因此,让我们替换掉这个开始按钮,然后回到工具箱,我将在这里使用我的瞬时按钮,它不像我正在使用的按钮那么灵活,但没关系。
So let's replace out this start button and come back over here into tool box and I'm going to take my momentary button here which isn't quite as flexible as the button that I'm using but that's OK.

我们在这里使用的地址是 B-3 3,所以我们知道我们要在开始按钮上寻找的地址。
And the address that we used from here was B-3 3 so that's what we know we're going to be looking for on our start button.

因此,让我们首先将四种颜色更改为黑色,然后将文本更改为“开始”,然后我们可以一一来到 RDF 上的 PLCC 属性。
So let's start by changing our four color to our black and we're going to change the text to say start and then we can come all the way down here to our PLCC properties that's on RDF one come one.

我们的地址将是我们在另一个“开始”按钮上的相同的 B-3 冒号三斜线三。
And our address is going to be our same B-3 colon three slash three that we had on our other Start button.

您知道,既然我们有一个开始按钮,那么我们就没有理由不能有一个停止按钮。
You know since we have a start button there is no reason we couldn't also have a stop button.

因此,我将复制并粘贴它,然后将其放在那里,让我们做同样的事情。
So I'm going to copy and paste that I'm going to put it right there and let's do the same thing.

让我们将那个人设置为我们的停止按钮。
Let's set that guy up to be our stop button.

回来并更改我们的文字以停止。
Come back up and change our text to stop.

我将向下滚动到这里,让我们看看杂项。
I'll scroll down here and let's take our under miscellaneous.

让我们更改按钮颜色,我们不希望它成为绿色按钮,我们希望它成为红色按钮,因为它是一个停止按钮,而且也将是一个瞬时设置。
Let's change our button color we don't want that to be a green button we want that to be a red button because it's a stop button and that will also be a momentary set.

我想快速回到这里来检查一下我们的地址,应该是 3 3 2。
And I want to pop back over here real quick just to check and see what our address is that should be be 3 3 2.

我要把它写在这里。
And I'm going to type that right in here.

所以我已经接到了 B-3 呼叫和三个斜杠,我只需将最后三个更改为两个,然后我们的运行指示器就在这里,让我们继续进行设置。
So I've already got the B-3 call and three slash and I'll just change that last three to a two and then we have our run indicator over here and let's go ahead and set that up.

那么我们的运行指示器的地址是 B-3 洞和三斜线八。
So what's our address for our run indicator that's going to be B-3 hole and three slash eight.

所以让我们改变我们的通讯驱动程序。
So let's change our comm driver.

看起来我们有几个额外的驱动程序神奇地出现了。
Looks like we've got a couple of extra drivers that just kind of magically popped up.

我只是要删除那些。
I'm just going to delete those.

我什至不确定那些来自哪里。
I'm not sure where those even came from.

让我们回到这里并将其更改为我们的 B-3 3 8。
And let's come back in here and change this to our B-3 3 8.

非常好。
Very good.

现在让我们继续设置该 COM 组件。
So now let's go ahead and set that COM component.

我们将使用 RDF 第一列和 PLCC 地址,我们将在其中获取 B-3 3:8。
We're going to be using RDF one column one and our PLCC address that's where we're going to get our B-3 3:8.

因此,B-3 跟注和三斜线 8 作为我们的跑动指示。
So B-3 call and three slash 8 for our run indication.

然后,如果我们向上滚动一点,我们的灯光颜色是绿色,这似乎适合运行灯。
And then if we scroll up a little bit here we've got our light color is green and that seems appropriate for a run light.

那么让我们继续尝试一下并确保我们的指标运行正确。
So let's go ahead and try this and make sure our indicator is running correctly.

所以看起来我们的系统正在运行。
So it looks like our system is running.

当我点击停止按钮时,我们就开始了。
When I click on the stop button there we go.

我们的系统停止了。
Our system stops.

当我单击“开始”按钮时,我们的系统再次运行,并且我们仍然在此处显示水箱液位。
And when I click on the Start button our system is running again and we're still displaying our tank level over here.

非常好,看起来一切正常。
So very good it looks like everything is working.

我将点击停止调试按钮,然后我们就得到了坦克的原始信号,但我们还可以展示一些更图形化和更强大的东西。
I'm going to click my stop debugging button and then we've got our raw signal for our tank but let's also show something a little bit more graphical and robust.

所以我要到这里来,我有一个坦克控制装置,我要把那个坦克拉到这里,然后让它长大一点。
So I'm going to come down here and I've got a tank control and I'm just going to pull that tank right over here and grow this up a little bit.

事实上,我实际上要把它做得大得令人讨厌。
In fact I actually am going to make this obnoxiously large.

我们开始吧。
There we go.

当我回到这里查看属性时,我得到了 PLCC 地址值。
And when I come back over here into properties I've got my PLCC address value.

所以在这种情况下,这将是我的水箱液位。
So in this case that's going to be my tank level.

让我们回到这里并获取水箱液位,这样 f 8 2 就是我们的缩放值。
Let's come back in here and get that tank level so that is f 8 2 is our scaled value.

因此,让我们回过头来,将该值设置为 f 8 冒号以达到完美。
So let's come back over and set that value to f 8 colon to perfect.

现在,对于我们的杂项,我们要确保最大值为 100,最小值为 0,因为这就是我们将其从 0 缩放到 100 的方式,并且我们的罐内容物颜色是黑色,这不太好有趣的。
And now for our miscellaneous we want to make sure we've got a max value of 100 and a min value of zero because that's how we're scaling this thing from 0 to 100 and our tank content color is black which isn't very interesting.

那么我们为什么不往水箱里加一些蓝色一点的东西呢?
So why don't we fill our tank up with something a little bit more blue.

完美的。
Perfect.

我将继续按下开始按钮,让我们看看我们是否已正确设置。
And I'm going to go ahead and hit the start button and let's see if we've got that set up correctly.

这是我们的界面。
So here's our interface.

果然,您可以看到我们的水箱中有一些蓝色液位。
And sure enough you can see we've got some blue level in our tank.

随着这个数字慢慢下降,我们的水箱液位也在下降,我们可以继续把它放下。
And as this number is coming down slowly our tank level is coming down and we can just go ahead and drop that.

所以我将把原始值降低到 3500,你就可以看到我们的水箱触底了。
So I'm just going to drop that raw value down to 3500 and you can see our tank bottoms out.

一旦他到达足够低的位置,我们的泵就会启动,开始填充我们的水箱。
And once he gets low enough there we go our pump starts back up starts filling our tank.

如果我只是追上去,你就能看到。
And if I just chase that up look you can see.

果然,我们的水箱正在加注,除非我按下停止按钮再次开始,然后我们的系统就会重新启动并立即恢复加注。
Sure enough our tank is filling unless I hit stop get started again and there we go our system comes back on and goes right back up to filling.

所以现在我们实际上可以获得一些数字。
So now we can actually get some numbers.

我们已经看到有一些不同的创意方式可以将它们显示在屏幕上。
We've seen that there's some different creative ways that we can display them on our screen.

我们可以发号码进去。
We can send numbers in.

我们可以发送位,也可以显示位。
We can send bits and we can display bits.

所以现在我们已经真正掌握了高级阶段的所有基础知识。
So at this point we've really got all the basics in advanced stage.

不幸的是,基础知识实际上是您在前期阶段所需要处理的全部内容。
My the unfortunate thing is that the basics are really all you've got to work with in advance stage.

我的这对你来说很酷,你可以用它来设计界面,你知道真的能想出一些非常漂亮的东西。
My this is something cool for you to play around with and you can use this to design interfaces and you know really come up with some pretty neat stuff.

事实上,它是免费的,仅仅因为这个原因就让它变得很棒。
And the fact that it's free makes this awesome just for that reason alone.

但它确实不具备在接下来的两项技术中您将看到的所有高级功能,并且您会爱上并说哇我想一直使用它。
But it really doesn't have all the advanced features that in the next two technologies you're going to see and you're going to fall in love with and say wow I want to use this all the time.

嗯,你知道这些东西不是免费的,而且这些东西通常也不是特别便宜。
Well you know those things aren't free and those things aren't even particularly cheap very often.

请随意尝试一下。
Please feel free to play around with this.

用它。
Use it.

我不建议将其用于任何完整的专业商业应用程序,但对于具有简单系统的极其注重预算的小型客户或个人项目,绝对没有理由不整天使用高级阶段的 Him-I。
I don't recommend this for any full on professional commercial applications but for extremely budget conscious smaller customers with simple systems or for personal projects there's absolutely no reason not to use advanced stage him-I all day long.

所以我会在下一讲中看到。
So I see in the next lecture.

干杯
Cheers